home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / CIncludes / QuickTimeMusic.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-22  |  70.0 KB  |  1,531 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        QuickTimeMusic.h
  3.  
  4.      Contains:    QuickTime interfaces
  5.  
  6.      Version:    Technology:    Technology:    QuickTime 2.5
  7.                  Package:    Universal Interfaces 2.1.4
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __QUICKTIMEMUSIC__
  19. #define __QUICKTIMEMUSIC__
  20.  
  21. #ifndef __COMPONENTS__
  22. #include <Components.h>
  23. #endif
  24. #ifndef __IMAGECOMPRESSION__
  25. #include <ImageCompression.h>
  26. #endif
  27. #ifndef __MOVIES__
  28. #include <Movies.h>
  29. #endif
  30. #ifndef __QUICKDRAW__
  31. #include <Quickdraw.h>
  32. #endif
  33. #ifndef __VIDEO__
  34. #include <Video.h>
  35. #endif
  36. #ifndef __MEMORY__
  37. #include <Memory.h>
  38. #endif
  39. #ifndef __SOUND__
  40. #include <Sound.h>
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT_SUPPORTED
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_ALIGN_SUPPORTED
  52. #pragma options align=mac68k
  53. #endif
  54.  
  55.  
  56. enum {
  57.     kaiToneDescType                = 'tone',
  58.     kaiNoteRequestInfoType        = 'ntrq',
  59.     kaiKnobListType                = 'knbl',
  60.     kaiKeyRangeInfoType            = 'sinf',
  61.     kaiSampleDescType            = 'sdsc',
  62.     kaiSampleInfoType            = 'smin',
  63.     kaiSampleDataType            = 'sdat',
  64.     kaiInstInfoType                = 'iinf',
  65.     kaiPictType                    = 'pict',
  66.     kaiWriterType                = '©wrt',
  67.     kaiCopyrightType            = '©cpy',
  68.     kaiOtherStrType                = 'str ',
  69.     kaiInstrumentRefType        = 'iref',
  70.     kaiLibraryInfoType            = 'linf',
  71.     kaiLibraryDescType            = 'ldsc'
  72. };
  73.  
  74. struct InstLibDescRec {
  75.     Str31                             libIDName;
  76. };
  77. typedef struct InstLibDescRec InstLibDescRec;
  78.  
  79. struct InstKnobRec {
  80.     long                             number;
  81.     long                             value;
  82. };
  83. typedef struct InstKnobRec InstKnobRec;
  84.  
  85.  
  86. enum {
  87.     kInstKnobMissingUnknown        = 0,
  88.     kInstKnobMissingDefault        = 1 << 0
  89. };
  90.  
  91. struct InstKnobList {
  92.     long                             knobCount;
  93.     long                             knobFlags;
  94.     InstKnobRec                     knob[1];
  95. };
  96. typedef struct InstKnobList InstKnobList;
  97.  
  98.  
  99. enum {
  100.     kMusicLoopTypeNormal        = 0,
  101.     kMusicLoopTypePalindrome    = 1                                /* back & forth*/
  102. };
  103.  
  104.  
  105. enum {
  106.     instSamplePreProcessFlag    = 1 << 0
  107. };
  108.  
  109. struct InstSampleDescRec {
  110.     OSType                             dataFormat;
  111.     short                             numChannels;
  112.     short                             sampleSize;
  113.     UnsignedFixed                     sampleRate;
  114.     short                             sampleDataID;
  115.     long                             offset;                        /* offset within SampleData - this could be just for internal use*/
  116.     long                             numSamples;                    /* this could also just be for internal use, we'll see*/
  117.  
  118.     long                             loopType;
  119.     long                             loopStart;
  120.     long                             loopEnd;
  121.  
  122.     long                             pitchNormal;
  123.     long                             pitchLow;
  124.     long                             pitchHigh;
  125. };
  126. typedef struct InstSampleDescRec InstSampleDescRec;
  127.  
  128. typedef Handle AtomicInstrument;
  129. typedef Ptr AtomicInstrumentPtr;
  130.  
  131. enum {
  132.     kMusicComponentType            = 'musi'
  133. };
  134.  
  135.  
  136. enum {
  137.     kSoftSynthComponentSubType    = 'ss  ',
  138.     kGMSynthComponentSubType    = 'gm  '
  139. };
  140.  
  141. typedef ComponentInstance MusicComponent;
  142. /* MusicSynthesizerFlags*/
  143.  
  144. enum {
  145.     kSynthesizerDynamicVoice    = 1 << 0,                        /* can assign voices on the fly (else, polyphony is very important */
  146.     kSynthesizerUsesMIDIPort    = 1 << 1,                        /* must be patched through MIDI Manager */
  147.     kSynthesizerMicrotone        = 1 << 2,                        /* can play microtonal scales */
  148.     kSynthesizerHasSamples        = 1 << 3,                        /* synthesizer has some use for sampled data */
  149.     kSynthesizerMixedDrums        = 1 << 4,                        /* any part can play drum parts, total = instrument parts */
  150.     kSynthesizerSoftware        = 1 << 5,                        /* implemented in main CPU software == uses cpu cycles */
  151.     kSynthesizerHardware        = 1 << 6,                        /* is a hardware device (such as nubus, or maybe DSP?) */
  152.     kSynthesizerDynamicChannel    = 1 << 7,                        /* can move any part to any channel or disable each part. (else we assume it lives on all channels in masks) */
  153.     kSynthesizerHogsSystemChannel = 1 << 8,                        /* can be channelwise dynamic, but always responds on its system channel */
  154.     kSynthesizerSlowSetPart        = 1 << 10,                        /* SetPart() and SetPartInstrumentNumber() calls do not have rapid response, may glitch notes */
  155.     kSynthesizerOffline            = 1 << 12,                        /* can enter an offline synthesis mode */
  156.     kSynthesizerGM                = 1 << 14,                        /* synth is a GM device */
  157.     kSynthesizerSoundLocalization = 1 << 16                        /* synth is a GM device */
  158. };
  159.  
  160. /*
  161.  * Note that these controller numbers
  162.  * are _not_ identical to the MIDI controller numbers.
  163.  * These are _signed_ 8.8 values, and the LSB's are
  164.  * always sent to a MIDI device. Controllers 32-63 are
  165.  * reserved (for MIDI, they are LSB's for 0-31, but we
  166.  * always send both).
  167.  *
  168.  * The full range, therefore, is -128.00 to 127.7f.
  169.  *
  170.  * _Excepting_ _volume_, all controls default to zero.
  171.  *
  172.  * Pitch bend is specified in fractional semitones! No
  173.  * more "pitch bend range" nonsense. You can bend as far
  174.  * as you want, any time you want.
  175. */
  176. typedef SInt32 MusicController;
  177.  
  178. enum {
  179.     kControllerModulationWheel    = 1,
  180.     kControllerBreath            = 2,
  181.     kControllerFoot                = 4,
  182.     kControllerPortamentoTime    = 5,                            /* portamento on/off is omitted, 0 time = 'off' */
  183.     kControllerVolume            = 7,
  184.     kControllerBalance            = 8,
  185.     kControllerPan                = 10,                            /* 0 - "default", 1 - n: positioned in output 1-n (incl fractions) */
  186.     kControllerExpression        = 11,
  187.     kControllerLever1            = 16,                            /* general purpose controllers */
  188.     kControllerLever2            = 17,                            /* general purpose controllers */
  189.     kControllerLever3            = 18,                            /* general purpose controllers */
  190.     kControllerLever4            = 19,                            /* general purpose controllers */
  191.     kControllerLever5            = 80,                            /* general purpose controllers */
  192.     kControllerLever6            = 81,                            /* general purpose controllers */
  193.     kControllerLever7            = 82,                            /* general purpose controllers */
  194.     kControllerLever8            = 83,                            /* general purpose controllers */
  195.     kControllerPitchBend        = 32,                            /* positive & negative semitones, with 7 bits fraction */
  196.     kControllerAfterTouch        = 33,                            /* aka channel pressure */
  197.     kControllerSustain            = 64,                            /* boolean - positive for on, 0 or negative off */
  198.     kControllerSostenuto        = 66,                            /* boolean */
  199.     kControllerSoftPedal        = 67,                            /* boolean */
  200.     kControllerReverb            = 91,
  201.     kControllerTremolo            = 92,
  202.     kControllerChorus            = 93,
  203.     kControllerCeleste            = 94,
  204.     kControllerPhaser            = 95,
  205.     kControllerEditPart            = 113,                            /* last 16 controllers 113-128 and above are global controllers which respond on part zero */
  206.     kControllerMasterTune        = 114
  207. };
  208.  
  209.  
  210. enum {
  211.     kControllerMaximum            = 0x7FFF,                        /* +01111111.11111111 */
  212.     kControllerMinimum            = 0x8000                        /* -10000000.00000000 */
  213. };
  214.  
  215. struct SynthesizerDescription {
  216.     OSType                             synthesizerType;            /* synthesizer type (must be same as component subtype) */
  217.     Str31                             name;                        /* text name of synthesizer type */
  218.     unsigned long                     flags;                        /* from the above enum */
  219.     unsigned long                     voiceCount;                    /* maximum polyphony */
  220.  
  221.     unsigned long                     partCount;                    /* maximum multi-timbrality (and midi channels) */
  222.     unsigned long                     instrumentCount;            /* non gm, built in (rom) instruments only */
  223.     unsigned long                     modifiableInstrumentCount;    /* plus n-more are user modifiable */
  224.     unsigned long                     channelMask;                /* (midi device only) which channels device always uses */
  225.  
  226.     unsigned long                     drumPartCount;                /* maximum multi-timbrality of drum parts */
  227.     unsigned long                     drumCount;                    /* non gm, built in (rom) drumkits only */
  228.     unsigned long                     modifiableDrumCount;        /* plus n-more are user modifiable */
  229.     unsigned long                     drumChannelMask;            /* (midi device only) which channels device always uses */
  230.  
  231.     unsigned long                     outputCount;                /* number of audio outputs (usually two) */
  232.     unsigned long                     latency;                    /* response time in µSec */
  233.  
  234.     unsigned long                     controllers[4];                /* array of 128 bits */
  235.     unsigned long                     gmInstruments[4];            /* array of 128 bits */
  236.     unsigned long                     gmDrums[4];                    /* array of 128 bits */
  237. };
  238. typedef struct SynthesizerDescription SynthesizerDescription;
  239.  
  240.  
  241. enum {
  242.     kVoiceCountDynamic            = -1                            /* constant to use to specify dynamic voicing */
  243. };
  244.  
  245. struct ToneDescription {
  246.     OSType                             synthesizerType;            /* synthesizer type */
  247.     Str31                             synthesizerName;            /* name of instantiation of synth */
  248.     Str31                             instrumentName;                /* preferred name for human use */
  249.     long                             instrumentNumber;            /* inst-number used if synth-name matches */
  250.     long                             gmNumber;                    /* Best matching general MIDI number */
  251. };
  252. typedef struct ToneDescription ToneDescription;
  253.  
  254.  
  255. enum {
  256.     kFirstDrumkit                = 16384,                        /* (first value is "no drum". instrument numbers from 16384->16384+128 are drumkits, and for GM they are _defined_ drumkits! */
  257.     kLastDrumkit                = (kFirstDrumkit + 128)
  258. };
  259.  
  260. /* InstrumentMatch*/
  261.  
  262. enum {
  263.     kInstrumentMatchSynthesizerType = 1,
  264.     kInstrumentMatchSynthesizerName = 2,
  265.     kInstrumentMatchName        = 4,
  266.     kInstrumentMatchNumber        = 8,
  267.     kInstrumentMatchGMNumber    = 16
  268. };
  269.  
  270. /* KnobFlags*/
  271.  
  272. enum {
  273.     kKnobReadOnly                = 16,                            /* knob value cannot be changed by user or with a SetKnob call */
  274.     kKnobInterruptUnsafe        = 32,                            /* only alter this knob from foreground task time (may access toolbox) */
  275.     kKnobKeyrangeOverride        = 64,                            /* knob can be overridden within a single keyrange (software synth only) */
  276.     kKnobGroupStart                = 128,                            /* knob is first in some logical group of knobs */
  277.     kKnobFixedPoint8            = 1024,
  278.     kKnobFixedPoint16            = 2048,                            /* One of these may be used at a time. */
  279.     kKnobTypeNumber                = 0 << 12,
  280.     kKnobTypeGroupName            = 1 << 12,                        /* "knob" is really a group name for display purposes */
  281.     kKnobTypeBoolean            = 2 << 12,                        /* if range is greater than 1, its a multi-checkbox field */
  282.     kKnobTypeNote                = 3 << 12,                        /* knob range is equivalent to MIDI keys */
  283.     kKnobTypePan                = 4 << 12,                        /* range goes left/right (lose this? ) */
  284.     kKnobTypeInstrument            = 5 << 12,                        /* knob value = reference to another instrument number */
  285.     kKnobTypeSetting            = 6 << 12,                        /* knob value is 1 of n different things (eg, fm algorithms) popup menu */
  286.     kKnobTypeMilliseconds        = 7 << 12,                        /* knob is a millisecond time range */
  287.     kKnobTypePercentage            = 8 << 12,                        /* knob range is displayed as a Percentage */
  288.     kKnobTypeHertz                = 9 << 12,                        /* knob represents frequency */
  289.     kKnobTypeButton                = 10 << 12                        /* momentary trigger push button */
  290. };
  291.  
  292.  
  293. enum {
  294.     kUnknownKnobValue            = 0x7FFFFFFF,                    /* a knob with this value means, we don't know it. */
  295.     kDefaultKnobValue            = 0x7FFFFFFE                    /* used to SET a knob to its default value. */
  296. };
  297.  
  298. struct KnobDescription {
  299.     Str63                             name;
  300.     long                             lowValue;
  301.     long                             highValue;
  302.     long                             defaultValue;                /* a default instrument is made of all default values */
  303.     long                             flags;
  304.     long                             knobID;
  305. };
  306. typedef struct KnobDescription KnobDescription;
  307.  
  308. struct GCInstrumentData {
  309.     ToneDescription                 tone;
  310.     long                             knobCount;
  311.     long                             knob[1];
  312. };
  313. typedef struct GCInstrumentData GCInstrumentData;
  314.  
  315. typedef GCInstrumentData *GCInstrumentDataPtr;
  316. typedef GCInstrumentDataPtr *GCInstrumentDataHandle;
  317. struct InstrumentAboutInfo {
  318.     PicHandle                         p;
  319.     Str255                             author;
  320.     Str255                             copyright;
  321.     Str255                             other;
  322. };
  323. typedef struct InstrumentAboutInfo InstrumentAboutInfo;
  324.  
  325.  
  326. enum {
  327.     kMusicPacketPortLost        = 1,                            /* received when application loses the default input port */
  328.     kMusicPacketPortFound        = 2,                            /* received when application gets it back out from under someone else's claim */
  329.     kMusicPacketTimeGap            = 3                                /* data[0] = number of milliseconds to keep the MIDI line silent */
  330. };
  331.  
  332. struct MusicMIDIPacket {
  333.     unsigned short                     length;
  334.     unsigned long                     reserved;                    /* if length zero, then reserved = above enum */
  335.     UInt8                             data[249];
  336. };
  337. typedef struct MusicMIDIPacket MusicMIDIPacket;
  338.  
  339. typedef pascal ComponentResult (*MusicMIDISendProcPtr)(MusicComponent self, long refCon, MusicMIDIPacket *mmp);
  340.  
  341. #if GENERATINGCFM
  342. typedef UniversalProcPtr MusicMIDISendUPP;
  343. #else
  344. typedef MusicMIDISendProcPtr MusicMIDISendUPP;
  345. #endif
  346. typedef pascal ComponentResult (*MusicMIDIReadHookProcPtr)(MusicMIDIPacket *mp, long myRefCon);
  347.  
  348. #if GENERATINGCFM
  349. typedef UniversalProcPtr MusicMIDIReadHookUPP;
  350. #else
  351. typedef MusicMIDIReadHookProcPtr MusicMIDIReadHookUPP;
  352. #endif
  353.  
  354. enum {
  355.     notImplementedMusicErr        = (0x80000000 | (0xFFFF & (notImplementedMusicOSErr))),
  356.     cantSendToSynthesizerErr    = (0x80000000 | (0xFFFF & (cantSendToSynthesizerOSErr))),
  357.     cantReceiveFromSynthesizerErr = (0x80000000 | (0xFFFF & (cantReceiveFromSynthesizerOSErr))),
  358.     illegalVoiceAllocationErr    = (0x80000000 | (0xFFFF & (illegalVoiceAllocationOSErr))),
  359.     illegalPartErr                = (0x80000000 | (0xFFFF & (illegalPartOSErr))),
  360.     illegalChannelErr            = (0x80000000 | (0xFFFF & (illegalChannelOSErr))),
  361.     illegalKnobErr                = (0x80000000 | (0xFFFF & (illegalKnobOSErr))),
  362.     illegalKnobValueErr            = (0x80000000 | (0xFFFF & (illegalKnobValueOSErr))),
  363.     illegalInstrumentErr        = (0x80000000 | (0xFFFF & (illegalInstrumentOSErr))),
  364.     illegalControllerErr        = (0x80000000 | (0xFFFF & (illegalControllerOSErr))),
  365.     midiManagerAbsentErr        = (0x80000000 | (0xFFFF & (midiManagerAbsentOSErr))),
  366.     synthesizerNotRespondingErr    = (0x80000000 | (0xFFFF & (synthesizerNotRespondingOSErr))),
  367.     synthesizerErr                = (0x80000000 | (0xFFFF & (synthesizerOSErr))),
  368.     illegalNoteChannelErr        = (0x80000000 | (0xFFFF & (illegalNoteChannelOSErr))),
  369.     noteChannelNotAllocatedErr    = (0x80000000 | (0xFFFF & (noteChannelNotAllocatedOSErr))),
  370.     tunePlayerFullErr            = (0x80000000 | (0xFFFF & (tunePlayerFullOSErr))),
  371.     tuneParseErr                = (0x80000000 | (0xFFFF & (tuneParseOSErr)))
  372. };
  373.  
  374.  
  375. enum {
  376.     kGetAtomicInstNoExpandedSamples = 1 << 0,
  377.     kGetAtomicInstNoOriginalSamples = 1 << 1,
  378.     kGetAtomicInstNoSamples        = kGetAtomicInstNoExpandedSamples | kGetAtomicInstNoOriginalSamples,
  379.     kGetAtomicInstNoKnobList    = 1 << 2,
  380.     kGetAtomicInstNoInstrumentInfo = 1 << 3,
  381.     kGetAtomicInstOriginalKnobList = 1 << 4,
  382.     kGetAtomicInstAllKnobs        = 1 << 5                        /* return even those that are set to default*/
  383. };
  384.  
  385. /*
  386.  For non-gm instruments, instrument number of tone description == 0
  387.  If you want to speed up while running, slam the inst num with what Get instrument number returns
  388.  All missing knobs are slammed to the default value
  389. */
  390.  
  391. enum {
  392.     kSetAtomicInstKeepOriginalInstrument = 1 << 0,
  393.     kSetAtomicInstShareAcrossParts = 1 << 1,                    /* inst disappears when app goes away*/
  394.     kSetAtomicInstCallerTosses    = 1 << 2,                        /* the caller isn't keeping a copy around (for NASetAtomicInstrument)*/
  395.     kSetAtomicInstCallerGuarantees = 1 << 3,                    /* the caller guarantees a copy is around*/
  396.     kSetAtomicInstInterruptSafe    = 1 << 4,                        /* dont move memory at this time (but process at next task time)*/
  397.     kSetAtomicInstDontPreprocess = 1 << 7                        /* perform no further preprocessing because either 1)you know the instrument is digitally clean, or 2) you got it from a GetPartAtomic*/
  398. };
  399.  
  400.  
  401. enum {
  402.     kInstrumentNamesModifiable    = 1,
  403.     kInstrumentNamesBoth        = 2
  404. };
  405.  
  406. /*
  407.  * Structures specific to the GenericMusicComponent
  408. */
  409.  
  410. enum {
  411.     kGenericMusicComponentSubtype = 'gene'
  412. };
  413.  
  414. struct GenericKnobDescription {
  415.     KnobDescription                 kd;
  416.     long                             hw1;                        /* driver defined */
  417.     long                             hw2;                        /* driver defined */
  418.     long                             hw3;                        /* driver defined */
  419.     long                             settingsID;                    /* resource ID list for boolean and popup names */
  420. };
  421. typedef struct GenericKnobDescription GenericKnobDescription;
  422.  
  423. struct GenericKnobDescriptionList {
  424.     long                             knobCount;
  425.     GenericKnobDescription             knob[1];
  426. };
  427. typedef struct GenericKnobDescriptionList GenericKnobDescriptionList;
  428.  
  429. typedef GenericKnobDescriptionList *GenericKnobDescriptionListPtr;
  430. typedef GenericKnobDescriptionListPtr *GenericKnobDescriptionListHandle;
  431. /* knobTypes for MusicDerivedSetKnob */
  432.  
  433. enum {
  434.     kGenericMusicKnob            = 1,
  435.     kGenericMusicInstrumentKnob    = 2,
  436.     kGenericMusicDrumKnob        = 3,
  437.     kGenericMusicGlobalController = 4
  438. };
  439.  
  440.  
  441. enum {
  442.     kGenericMusicResFirst        = 0,
  443.     kGenericMusicResMiscStringList = 1,                            /* STR# 1: synth name, 2:about author,3:aboutcopyright,4:aboutother */
  444.     kGenericMusicResMiscLongList = 2,                            /* Long various params, see list below */
  445.     kGenericMusicResInstrumentList = 3,                            /* NmLs of names and shorts, categories prefixed by '••' */
  446.     kGenericMusicResDrumList    = 4,                            /* NmLs of names and shorts */
  447.     kGenericMusicResInstrumentKnobDescriptionList = 5,            /* Knob */
  448.     kGenericMusicResDrumKnobDescriptionList = 6,                /* Knob */
  449.     kGenericMusicResKnobDescriptionList = 7,                    /* Knob */
  450.     kGenericMusicResBitsLongList = 8,                            /* Long back to back bitmaps of controllers, gminstruments, and drums */
  451.     kGenericMusicResModifiableInstrumentHW = 9,                    /* Shrt same as the hw shorts trailing the instrument names, a shortlist */
  452.     kGenericMusicResGMTranslation = 10,                            /* Long 128 long entries, 1 for each gm inst, of local instrument numbers 1-n (not hw numbers) */
  453.     kGenericMusicResROMInstrumentData = 11,                        /* knob lists for ROM instruments, so the knob values may be known */
  454.     kGenericMusicResAboutPICT    = 12,                            /* picture for aboutlist. must be present for GetAbout call to work */
  455.     kGenericMusicResLast        = 13
  456. };
  457.  
  458. /* elements of the misc long list */
  459.  
  460. enum {
  461.     kGenericMusicMiscLongFirst    = 0,
  462.     kGenericMusicMiscLongVoiceCount = 1,
  463.     kGenericMusicMiscLongPartCount = 2,
  464.     kGenericMusicMiscLongModifiableInstrumentCount = 3,
  465.     kGenericMusicMiscLongChannelMask = 4,
  466.     kGenericMusicMiscLongDrumPartCount = 5,
  467.     kGenericMusicMiscLongModifiableDrumCount = 6,
  468.     kGenericMusicMiscLongDrumChannelMask = 7,
  469.     kGenericMusicMiscLongOutputCount = 8,
  470.     kGenericMusicMiscLongLatency = 9,
  471.     kGenericMusicMiscLongFlags    = 10,
  472.     kGenericMusicMiscLongFirstGMHW = 11,                        /* number to add to locate GM main instruments */
  473.     kGenericMusicMiscLongFirstGMDrumHW = 12,                    /* number to add to locate GM drumkits */
  474.     kGenericMusicMiscLongFirstUserHW = 13,                        /* First hw number of user instruments (presumed sequential) */
  475.     kGenericMusicMiscLongLast    = 14
  476. };
  477.  
  478. struct GCPart {
  479.     long                             hwInstrumentNumber;            /* internal number of recalled instrument */
  480.     short                             controller[128];            /* current values for all controllers */
  481.     long                             volume;                        /* ctrl 7 is special case */
  482.     long                             polyphony;
  483.     long                             midiChannel;                /* 1-16 if in use */
  484.     GCInstrumentData                 id;                            /* ToneDescription & knoblist, uncertain length */
  485. };
  486. typedef struct GCPart GCPart;
  487.  
  488. /*
  489.  * Calls specific to the GenericMusicComponent
  490. */
  491.  
  492. enum {
  493.     kMusicGenericRange            = 0x0100,
  494.     kMusicDerivedRange            = 0x0200
  495. };
  496.  
  497. /*
  498.  * Flags in GenericMusicConfigure call
  499. */
  500.  
  501. enum {
  502.     kGenericMusicDoMIDI            = 1 << 0,                        /* implement normal MIDI messages for note, controllers, and program changes 0-127 */
  503.     kGenericMusicBank0            = 1 << 1,                        /* implement instrument bank changes on controller 0 */
  504.     kGenericMusicBank32            = 1 << 2,                        /* implement instrument bank changes on controller 32 */
  505.     kGenericMusicErsatzMIDI        = 1 << 3,                        /* construct MIDI packets, but send them to the derived component */
  506.     kGenericMusicCallKnobs        = 1 << 4,                        /* call the derived component with special knob format call */
  507.     kGenericMusicCallParts        = 1 << 5,                        /* call the derived component with special part format call */
  508.     kGenericMusicCallInstrument    = 1 << 6,                        /* call MusicDerivedSetInstrument for MusicSetInstrument calls */
  509.     kGenericMusicCallNumber        = 1 << 7,                        /* call MusicDerivedSetPartInstrumentNumber for MusicSetPartInstrumentNumber calls, & don't send any C0 or bank stuff */
  510.     kGenericMusicCallROMInstrument = 1 << 8,                    /* call MusicSetInstrument for MusicSetPartInstrumentNumber for "ROM" instruments, passing params from the ROMi resource */
  511.     kGenericMusicAllDefaults    = 1 << 9                        /* indicates that when a new instrument is recalled, all knobs are reset to DEFAULT settings. True for GS modules */
  512. };
  513.  
  514. typedef pascal ComponentResult (*MusicOfflineDataProcPtr)(Ptr SoundData, long numBytes, long myRefCon);
  515.  
  516. #if GENERATINGCFM
  517. typedef UniversalProcPtr MusicOfflineDataUPP;
  518. #else
  519. typedef MusicOfflineDataProcPtr MusicOfflineDataUPP;
  520. #endif
  521. struct OfflineSampleType {
  522.     unsigned long                     numChannels;                /*number of channels,  ie mono = 1*/
  523.     UnsignedFixed                     sampleRate;                    /*sample rate in Apples Fixed point representation*/
  524.     unsigned short                     sampleSize;                    /*number of bits in sample*/
  525. };
  526. typedef struct OfflineSampleType OfflineSampleType;
  527.  
  528. struct InstrumentInfoRecord {
  529.     long                             instrumentNumber;            /* instrument number (if 0, name is a catagory)*/
  530.     long                             flags;                        /* show in picker, etc.*/
  531.     long                             toneNameIndex;                /* index in toneNames (1 based)*/
  532.     long                             itxtNameAtomID;                /* index in itxtNames (itxt/name by index)*/
  533. };
  534. typedef struct InstrumentInfoRecord InstrumentInfoRecord;
  535.  
  536. struct InstrumentInfoList {
  537.     long                             recordCount;
  538.     Handle                             toneNames;                    /* name from tone description*/
  539.     QTAtomContainer                 itxtNames;                    /* itxt/name atoms for instruments*/
  540.     InstrumentInfoRecord             info[1];
  541. };
  542. typedef struct InstrumentInfoList InstrumentInfoList;
  543.  
  544. typedef InstrumentInfoList *InstrumentInfoListPtr;
  545. typedef InstrumentInfoListPtr *InstrumentInfoListHandle;
  546. extern pascal ComponentResult MusicGetDescription(MusicComponent mc, SynthesizerDescription *sd)
  547.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  548.  
  549. extern pascal ComponentResult MusicGetPart(MusicComponent mc, long part, long *midiChannel, long *polyphony)
  550.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0002, 0x7000, 0xA82A);
  551.  
  552. extern pascal ComponentResult MusicSetPart(MusicComponent mc, long part, long midiChannel, long polyphony)
  553.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0003, 0x7000, 0xA82A);
  554.  
  555. extern pascal ComponentResult MusicSetPartInstrumentNumber(MusicComponent mc, long part, long instrumentNumber)
  556.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  557.  
  558. #if OLDROUTINENAMES
  559. #define MusicSetInstrumentNumber(ci,part,instrumentNumber) MusicSetPartInstrumentNumber(ci, part,instrumentNumber)
  560. #endif
  561. extern pascal ComponentResult MusicGetPartInstrumentNumber(MusicComponent mc, long part)
  562.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  563.  
  564. extern pascal ComponentResult MusicStorePartInstrument(MusicComponent mc, long part, long instrumentNumber)
  565.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0006, 0x7000, 0xA82A);
  566.  
  567. extern pascal ComponentResult MusicGetPartAtomicInstrument(MusicComponent mc, long part, AtomicInstrument *ai, long flags)
  568.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0009, 0x7000, 0xA82A);
  569.  
  570. extern pascal ComponentResult MusicSetPartAtomicInstrument(MusicComponent mc, long part, AtomicInstrumentPtr aiP, long flags)
  571.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000A, 0x7000, 0xA82A);
  572.  
  573. /* Obsolete calls*/
  574. extern pascal ComponentResult MusicGetInstrumentKnobDescriptionObsolete(MusicComponent mc, long knobIndex, void *mkd)
  575.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000D, 0x7000, 0xA82A);
  576.  
  577. extern pascal ComponentResult MusicGetDrumKnobDescriptionObsolete(MusicComponent mc, long knobIndex, void *mkd)
  578.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000E, 0x7000, 0xA82A);
  579.  
  580. extern pascal ComponentResult MusicGetKnobDescriptionObsolete(MusicComponent mc, long knobIndex, void *mkd)
  581.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000F, 0x7000, 0xA82A);
  582.  
  583. extern pascal ComponentResult MusicGetPartKnob(MusicComponent mc, long part, long knobID)
  584.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0010, 0x7000, 0xA82A);
  585.  
  586. extern pascal ComponentResult MusicSetPartKnob(MusicComponent mc, long part, long knobID, long knobValue)
  587.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0011, 0x7000, 0xA82A);
  588.  
  589. extern pascal ComponentResult MusicGetKnob(MusicComponent mc, long knobID)
  590.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0012, 0x7000, 0xA82A);
  591.  
  592. extern pascal ComponentResult MusicSetKnob(MusicComponent mc, long knobID, long knobValue)
  593.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0013, 0x7000, 0xA82A);
  594.  
  595. extern pascal ComponentResult MusicGetPartName(MusicComponent mc, long part, StringPtr name)
  596.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0014, 0x7000, 0xA82A);
  597.  
  598. extern pascal ComponentResult MusicSetPartName(MusicComponent mc, long part, StringPtr name)
  599.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0015, 0x7000, 0xA82A);
  600.  
  601. extern pascal ComponentResult MusicFindTone(MusicComponent mc, ToneDescription *td, long *instrumentNumber, unsigned long *fit)
  602.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0016, 0x7000, 0xA82A);
  603.  
  604. extern pascal ComponentResult MusicPlayNote(MusicComponent mc, long part, long pitch, long velocity)
  605.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0017, 0x7000, 0xA82A);
  606.  
  607. extern pascal ComponentResult MusicResetPart(MusicComponent mc, long part)
  608.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  609.  
  610. extern pascal ComponentResult MusicSetPartController(MusicComponent mc, long part, MusicController controllerNumber, long controllerValue)
  611.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  612.  
  613. #if OLDROUTINENAMES
  614. #define MusicSetController(ci,part,controllerNumber,controllerValue) MusicSetPartController(ci, part,controllerNumber,controllerValue)
  615. #endif
  616. extern pascal ComponentResult MusicGetPartController(MusicComponent mc, long part, MusicController controllerNumber)
  617.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001A, 0x7000, 0xA82A);
  618.  
  619. extern pascal ComponentResult MusicGetMIDIProc(MusicComponent mc, MusicMIDISendUPP *midiSendProc, long *refCon)
  620.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  621.  
  622. extern pascal ComponentResult MusicSetMIDIProc(MusicComponent mc, MusicMIDISendUPP midiSendProc, long refCon)
  623.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001C, 0x7000, 0xA82A);
  624.  
  625. extern pascal ComponentResult MusicGetInstrumentNames(MusicComponent mc, long modifiableInstruments, Handle *instrumentNames, Handle *instrumentCategoryLasts, Handle *instrumentCategoryNames)
  626.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x001D, 0x7000, 0xA82A);
  627.  
  628. extern pascal ComponentResult MusicGetDrumNames(MusicComponent mc, long modifiableInstruments, Handle *instrumentNumbers, Handle *instrumentNames)
  629.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x001E, 0x7000, 0xA82A);
  630.  
  631. extern pascal ComponentResult MusicGetMasterTune(MusicComponent mc)
  632.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x001F, 0x7000, 0xA82A);
  633.  
  634. extern pascal ComponentResult MusicSetMasterTune(MusicComponent mc, long masterTune)
  635.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0020, 0x7000, 0xA82A);
  636.  
  637. extern pascal ComponentResult MusicGetInstrumentAboutInfo(MusicComponent mc, long part, InstrumentAboutInfo *iai)
  638.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  639.  
  640. extern pascal ComponentResult MusicGetDeviceConnection(MusicComponent mc, long index, long *id1, long *id2)
  641.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0023, 0x7000, 0xA82A);
  642.  
  643. extern pascal ComponentResult MusicUseDeviceConnection(MusicComponent mc, long id1, long id2)
  644.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0024, 0x7000, 0xA82A);
  645.  
  646. extern pascal ComponentResult MusicGetKnobSettingStrings(MusicComponent mc, long knobIndex, long isGlobal, Handle *settingsNames, Handle *settingsCategoryLasts, Handle *settingsCategoryNames)
  647.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0025, 0x7000, 0xA82A);
  648.  
  649. extern pascal ComponentResult MusicGetMIDIPorts(MusicComponent mc, long *inputPortCount, long *outputPortCount)
  650.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0026, 0x7000, 0xA82A);
  651.  
  652. extern pascal ComponentResult MusicSendMIDI(MusicComponent mc, long portIndex, MusicMIDIPacket *mp)
  653.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0027, 0x7000, 0xA82A);
  654.  
  655. extern pascal ComponentResult MusicReceiveMIDI(MusicComponent mc, MusicMIDIReadHookUPP readHook, long refCon)
  656.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0028, 0x7000, 0xA82A);
  657.  
  658. extern pascal ComponentResult MusicStartOffline(MusicComponent mc, unsigned long *numChannels, UnsignedFixed *sampleRate, unsigned short *sampleSize, MusicOfflineDataUPP dataProc, long dataProcRefCon)
  659.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0029, 0x7000, 0xA82A);
  660.  
  661. extern pascal ComponentResult MusicSetOfflineTimeTo(MusicComponent mc, long newTimeStamp)
  662.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x002A, 0x7000, 0xA82A);
  663.  
  664. extern pascal ComponentResult MusicGetInstrumentKnobDescription(MusicComponent mc, long knobIndex, KnobDescription *mkd)
  665.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002B, 0x7000, 0xA82A);
  666.  
  667. extern pascal ComponentResult MusicGetDrumKnobDescription(MusicComponent mc, long knobIndex, KnobDescription *mkd)
  668.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002C, 0x7000, 0xA82A);
  669.  
  670. extern pascal ComponentResult MusicGetKnobDescription(MusicComponent mc, long knobIndex, KnobDescription *mkd)
  671.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002D, 0x7000, 0xA82A);
  672.  
  673. extern pascal ComponentResult MusicGetInfoText(MusicComponent mc, long selector, Handle *textH, Handle *styleH)
  674.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x002E, 0x7000, 0xA82A);
  675.  
  676.  
  677. enum {
  678.     kGetInstrumentInfoNoBuiltIn    = 1 << 0,
  679.     kGetInstrumentInfoMidiUserInst = 1 << 1,
  680.     kGetInstrumentInfoNoIText    = 1 << 2
  681. };
  682.  
  683. extern pascal ComponentResult MusicGetInstrumentInfo(MusicComponent mc, long getInstrumentInfoFlags, InstrumentInfoListHandle *infoListH)
  684.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002F, 0x7000, 0xA82A);
  685.  
  686. extern pascal ComponentResult MusicTask(MusicComponent mc)
  687.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0031, 0x7000, 0xA82A);
  688.  
  689. extern pascal ComponentResult MusicSetPartInstrumentNumberInterruptSafe(MusicComponent mc, long part, long instrumentNumber)
  690.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0032, 0x7000, 0xA82A);
  691.  
  692. extern pascal ComponentResult MusicSetPartSoundLocalization(MusicComponent mc, long part, Handle data)
  693.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0033, 0x7000, 0xA82A);
  694.  
  695. extern pascal ComponentResult MusicGenericConfigure(MusicComponent mc, long mode, long flags, long baseResID)
  696.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0100, 0x7000, 0xA82A);
  697.  
  698. extern pascal ComponentResult MusicGenericGetPart(MusicComponent mc, long partNumber, GCPart **part)
  699.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0101, 0x7000, 0xA82A);
  700.  
  701. extern pascal ComponentResult MusicGenericGetKnobList(MusicComponent mc, long knobType, GenericKnobDescriptionListHandle *gkdlH)
  702.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0102, 0x7000, 0xA82A);
  703.  
  704. extern pascal ComponentResult MusicDerivedMIDISend(MusicComponent mc, MusicMIDIPacket *packet)
  705.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0200, 0x7000, 0xA82A);
  706.  
  707. extern pascal ComponentResult MusicDerivedSetKnob(MusicComponent mc, long knobType, long knobNumber, long knobValue, long partNumber, GCPart *p, GenericKnobDescription *gkd)
  708.  FIVEWORDINLINE(0x2F3C, 0x0018, 0x0201, 0x7000, 0xA82A);
  709.  
  710. extern pascal ComponentResult MusicDerivedSetPart(MusicComponent mc, long partNumber, GCPart *p)
  711.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0202, 0x7000, 0xA82A);
  712.  
  713. extern pascal ComponentResult MusicDerivedSetInstrument(MusicComponent mc, long partNumber, GCPart *p)
  714.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0203, 0x7000, 0xA82A);
  715.  
  716. extern pascal ComponentResult MusicDerivedSetPartInstrumentNumber(MusicComponent mc, long partNumber, GCPart *p)
  717.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0204, 0x7000, 0xA82A);
  718.  
  719. extern pascal ComponentResult MusicDerivedSetMIDI(MusicComponent mc, MusicMIDISendProcPtr midiProc, long refcon, long midiChannel)
  720.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0205, 0x7000, 0xA82A);
  721.  
  722. extern pascal ComponentResult MusicDerivedStorePartInstrument(MusicComponent mc, long partNumber, GCPart *p, long instrumentNumber)
  723.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0206, 0x7000, 0xA82A);
  724.  
  725. /* Mask bit for returned value by InstrumentFind.*/
  726.  
  727. enum {
  728.     kInstrumentExactMatch        = 0x00020000,
  729.     kInstrumentRecommendedSubstitute = 0x00010000,
  730.     kInstrumentQualityField        = 0xFF000000,
  731.     kInstrumentRoland8BitQuality = 0x05000000
  732. };
  733.  
  734. typedef InstrumentAboutInfo *InstrumentAboutInfoPtr;
  735. typedef InstrumentAboutInfoPtr *InstrumentAboutInfoHandle;
  736. struct GMInstrumentInfo {
  737.     long                             cmpInstID;
  738.     long                             gmInstNum;
  739.     long                             instMatch;
  740. };
  741. typedef struct GMInstrumentInfo GMInstrumentInfo;
  742.  
  743. typedef GMInstrumentInfo *GMInstrumentInfoPtr;
  744. typedef GMInstrumentInfoPtr *GMInstrumentInfoHandle;
  745. struct nonGMInstrumentInfoRecord {
  746.     long                             cmpInstID;                    /* if 0, category name*/
  747.     long                             flags;                        /* match, show in picker*/
  748.     long                             toneNameIndex;                /* index in toneNames (1 based)*/
  749.     long                             itxtNameAtomID;                /* index in itxtNames (itxt/name by index)*/
  750. };
  751. typedef struct nonGMInstrumentInfoRecord nonGMInstrumentInfoRecord;
  752.  
  753. struct nonGMInstrumentInfo {
  754.     long                             recordCount;
  755.     Handle                             toneNames;                    /* name from tone description*/
  756.     QTAtomContainer                 itxtNames;                    /* itext/name atoms for instruments*/
  757.     nonGMInstrumentInfoRecord         instInfo[1];
  758. };
  759. typedef struct nonGMInstrumentInfo nonGMInstrumentInfo;
  760.  
  761. typedef nonGMInstrumentInfo *nonGMInstrumentInfoPtr;
  762. typedef nonGMInstrumentInfoPtr *nonGMInstrumentInfoHandle;
  763. struct InstCompInfo {
  764.     long                             infoSize;                    /* size of this record*/
  765.     Str31                             InstrumentLibraryName;
  766.     QTAtomContainer                 InstrumentLibraryITxt;        /* itext/name atoms for instruments*/
  767.     long                             GMinstrumentCount;
  768.     GMInstrumentInfoHandle             GMinstrumentInfo;
  769.     long                             GMdrumCount;
  770.     GMInstrumentInfoHandle             GMdrumInfo;
  771.     long                             nonGMinstrumentCount;
  772.     nonGMInstrumentInfoHandle         nonGMinstrumentInfo;
  773. };
  774. typedef struct InstCompInfo InstCompInfo;
  775.  
  776. typedef InstCompInfo *InstCompInfoPtr;
  777. typedef InstCompInfoPtr *InstCompInfoHandle;
  778. extern pascal ComponentResult InstrumentGetInst(ComponentInstance ci, long instID, AtomicInstrument *atomicInst, long flags)
  779.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0001, 0x7000, 0xA82A);
  780.  
  781. extern pascal ComponentResult InstrumentGetInfo(ComponentInstance ci, long getInstrumentInfoFlags, InstCompInfoHandle *instInfo)
  782.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  783.  
  784. extern pascal ComponentResult InstrumentInitialize(ComponentInstance ci, long initFormat, void *initParams)
  785.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  786.  
  787. extern pascal ComponentResult InstrumentOpenComponentResFile(ComponentInstance ci, short *resFile)
  788.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  789.  
  790. extern pascal ComponentResult InstrumentCloseComponentResFile(ComponentInstance ci, short resFile)
  791.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0005, 0x7000, 0xA82A);
  792.  
  793. extern pascal ComponentResult InstrumentGetComponentRefCon(ComponentInstance ci, void **refCon)
  794.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  795.  
  796. extern pascal ComponentResult InstrumentSetComponentRefCon(ComponentInstance ci, void *refCon)
  797.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  798.  
  799. /*
  800. --------------------------
  801.     Types
  802. --------------------------
  803. */
  804.  
  805. enum {
  806.     kSynthesizerConnectionMono    = 1,                            /* if set, and synth can be mono/poly, then the partCount channels from the system channel are hogged */
  807.     kSynthesizerConnectionMMgr    = 2,                            /* this connection imported from the MIDI Mgr */
  808.     kSynthesizerConnectionOMS    = 4,                            /* this connection imported from OMS */
  809.     kSynthesizerConnectionQT    = 8,                            /* this connection is a QuickTime-only port */
  810.     kSynthesizerConnectionFMS    = 16                            /* this connection imported from FMS */
  811. };
  812.  
  813. /* used for MIDI device only */
  814. struct SynthesizerConnections {
  815.     OSType                             clientID;
  816.     OSType                             inputPortID;                /* terminology death: this port is used to SEND to the midi synth */
  817.     OSType                             outputPortID;                /* terminology death: this port receives from a keyboard or other control device */
  818.     long                             midiChannel;                /* The system channel; others are configurable (or the nubus slot number) */
  819.     long                             flags;
  820.     long                             unique;                        /* unique id may be used instead of index, to getinfo and unregister calls */
  821.     long                             reserved1;                    /* should be zero */
  822.     long                             reserved2;                    /* should be zero */
  823. };
  824. typedef struct SynthesizerConnections SynthesizerConnections;
  825.  
  826. struct QTMIDIPort {
  827.     SynthesizerConnections             portConnections;
  828.     Str63                             portName;
  829. };
  830. typedef struct QTMIDIPort QTMIDIPort;
  831.  
  832.  
  833. enum {
  834.     kNoteRequestNoGM            = 1,                            /* dont degrade to a GM synth */
  835.     kNoteRequestNoSynthType        = 2,                            /* dont degrade to another synth of same type but different name */
  836.     kNoteRequestSynthMustMatch    = 4                                /* synthType must be a match, including kGMSynthComponentSubType */
  837. };
  838.  
  839. typedef ComponentInstance NoteAllocator;
  840. struct NoteRequestInfo {
  841.     UInt8                             flags;                        /* 1: dont accept GM match, 2: dont accept same-synth-type match */
  842.     UInt8                             reserved;                    /* must be zero */
  843.     short                             polyphony;                    /* Maximum number of voices */
  844.     Fixed                             typicalPolyphony;            /* Hint for level mixing */
  845. };
  846. typedef struct NoteRequestInfo NoteRequestInfo;
  847.  
  848. struct NoteRequest {
  849.     NoteRequestInfo                 info;
  850.     ToneDescription                 tone;
  851. };
  852. typedef struct NoteRequest NoteRequest;
  853.  
  854. typedef struct OpaqueNoteChannel* NoteChannel;
  855.  
  856. enum {
  857.     kPickDontMix                = 1,                            /* dont mix instruments with drum sounds */
  858.     kPickSameSynth                = 2,                            /* only allow the same device that went in, to come out */
  859.     kPickUserInsts                = 4,                            /* show user insts in addition to ROM voices */
  860.     kPickEditAllowEdit            = 8,                            /* lets user switch over to edit mode */
  861.     kPickEditAllowPick            = 16,                            /* lets the user switch over to pick mode */
  862.     kPickEditSynthGlobal        = 32,                            /* edit the global knobs of the synth */
  863.     kPickEditControllers        = 64                            /* edit the controllers of the notechannel */
  864. };
  865.  
  866.  
  867. enum {
  868.     kNoteAllocatorComponentType    = 'nota'
  869. };
  870.  
  871. /*
  872. --------------------------------
  873.     Note Allocator Prototypes
  874. --------------------------------
  875. */
  876. extern pascal ComponentResult NARegisterMusicDevice(NoteAllocator ci, OSType synthType, Str31 name, SynthesizerConnections *connections)
  877.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0000, 0x7000, 0xA82A);
  878.  
  879. extern pascal ComponentResult NAUnregisterMusicDevice(NoteAllocator ci, long index)
  880.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  881.  
  882. extern pascal ComponentResult NAGetRegisteredMusicDevice(NoteAllocator ci, long index, OSType *synthType, Str31 name, SynthesizerConnections *connections, MusicComponent *mc)
  883.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0002, 0x7000, 0xA82A);
  884.  
  885. extern pascal ComponentResult NASaveMusicConfiguration(NoteAllocator ci)
  886.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0003, 0x7000, 0xA82A);
  887.  
  888. extern pascal ComponentResult NANewNoteChannel(NoteAllocator ci, NoteRequest *noteRequest, NoteChannel *outChannel)
  889.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  890.  
  891. extern pascal ComponentResult NADisposeNoteChannel(NoteAllocator ci, NoteChannel noteChannel)
  892.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  893.  
  894. extern pascal ComponentResult NAGetNoteChannelInfo(NoteAllocator ci, NoteChannel noteChannel, long *index, long *part)
  895.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0006, 0x7000, 0xA82A);
  896.  
  897. extern pascal ComponentResult NAPrerollNoteChannel(NoteAllocator ci, NoteChannel noteChannel)
  898.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  899.  
  900. extern pascal ComponentResult NAUnrollNoteChannel(NoteAllocator ci, NoteChannel noteChannel)
  901.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0008, 0x7000, 0xA82A);
  902.  
  903. extern pascal ComponentResult NASetNoteChannelVolume(NoteAllocator ci, NoteChannel noteChannel, Fixed volume)
  904.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  905.  
  906. extern pascal ComponentResult NAResetNoteChannel(NoteAllocator ci, NoteChannel noteChannel)
  907.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  908.  
  909. extern pascal ComponentResult NAPlayNote(NoteAllocator ci, NoteChannel noteChannel, long pitch, long velocity)
  910.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000D, 0x7000, 0xA82A);
  911.  
  912. extern pascal ComponentResult NASetController(NoteAllocator ci, NoteChannel noteChannel, long controllerNumber, long controllerValue)
  913.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000E, 0x7000, 0xA82A);
  914.  
  915. extern pascal ComponentResult NASetKnob(NoteAllocator ci, NoteChannel noteChannel, long knobNumber, long knobValue)
  916.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000F, 0x7000, 0xA82A);
  917.  
  918. extern pascal ComponentResult NAFindNoteChannelTone(NoteAllocator ci, NoteChannel noteChannel, ToneDescription *td, long *instrumentNumber)
  919.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0010, 0x7000, 0xA82A);
  920.  
  921. extern pascal ComponentResult NASetInstrumentNumber(NoteAllocator ci, NoteChannel noteChannel, long instrumentNumber)
  922.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0011, 0x7000, 0xA82A);
  923.  
  924. #if OLDROUTINENAMES
  925. #define NASetNoteChannelInstrument(ci, noteChannel,instrumentNumber ) NASetInstrumentNumber(ci, noteChannel,instrumentNumber)
  926. #define NASetInstrument(ci, noteChannel,instrumentNumber ) NASetInstrumentNumber(ci, noteChannel,instrumentNumber)
  927. #endif
  928. extern pascal ComponentResult NAPickInstrument(NoteAllocator ci, ModalFilterUPP filterProc, StringPtr prompt, ToneDescription *sd, unsigned long flags, long refCon, long reserved1, long reserved2)
  929.  FIVEWORDINLINE(0x2F3C, 0x001C, 0x0012, 0x7000, 0xA82A);
  930.  
  931. extern pascal ComponentResult NAPickArrangement(NoteAllocator ci, ModalFilterUPP filterProc, StringPtr prompt, long zero1, long zero2, Track t, StringPtr songName)
  932.  FIVEWORDINLINE(0x2F3C, 0x0018, 0x0013, 0x7000, 0xA82A);
  933.  
  934. extern pascal ComponentResult NASetDefaultMIDIInput(NoteAllocator ci, SynthesizerConnections *sc)
  935.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0015, 0x7000, 0xA82A);
  936.  
  937. extern pascal ComponentResult NAGetDefaultMIDIInput(NoteAllocator ci, SynthesizerConnections *sc)
  938.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0016, 0x7000, 0xA82A);
  939.  
  940. extern pascal ComponentResult NAUseDefaultMIDIInput(NoteAllocator ci, MusicMIDIReadHookUPP readHook, long refCon, unsigned long flags)
  941.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  942.  
  943. extern pascal ComponentResult NALoseDefaultMIDIInput(NoteAllocator ci)
  944.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x001A, 0x7000, 0xA82A);
  945.  
  946. extern pascal ComponentResult NAStuffToneDescription(NoteAllocator ci, long gmNumber, ToneDescription *td)
  947.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  948.  
  949. extern pascal ComponentResult NACopyrightDialog(NoteAllocator ci, PicHandle p, StringPtr author, StringPtr copyright, StringPtr other, StringPtr title, ModalFilterUPP filterProc, long refCon)
  950.  FIVEWORDINLINE(0x2F3C, 0x001C, 0x001C, 0x7000, 0xA82A);
  951.  
  952. /*
  953.     kNADummyOneSelect = 29
  954.     kNADummyTwoSelect = 30
  955. */
  956. extern pascal ComponentResult NAGetIndNoteChannel(NoteAllocator ci, long index, NoteChannel *nc, long *seed)
  957.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x001F, 0x7000, 0xA82A);
  958.  
  959. extern pascal ComponentResult NAGetMIDIPorts(NoteAllocator ci, Handle *inputPorts, Handle *outputPorts)
  960.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0021, 0x7000, 0xA82A);
  961.  
  962. extern pascal ComponentResult NAGetNoteRequest(NoteAllocator ci, NoteChannel noteChannel, NoteRequest *nrOut)
  963.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  964.  
  965. extern pascal ComponentResult NASendMIDI(NoteAllocator ci, NoteChannel noteChannel, MusicMIDIPacket *mp)
  966.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0023, 0x7000, 0xA82A);
  967.  
  968. extern pascal ComponentResult NAPickEditInstrument(NoteAllocator ci, ModalFilterUPP filterProc, StringPtr prompt, long refCon, NoteChannel nc, AtomicInstrument ai, long flags)
  969.  FIVEWORDINLINE(0x2F3C, 0x0018, 0x0024, 0x7000, 0xA82A);
  970.  
  971. extern pascal ComponentResult NANewNoteChannelFromAtomicInstrument(NoteAllocator ci, AtomicInstrumentPtr instrument, long flags, NoteChannel *outChannel)
  972.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0025, 0x7000, 0xA82A);
  973.  
  974. extern pascal ComponentResult NASetAtomicInstrument(NoteAllocator ci, NoteChannel noteChannel, AtomicInstrumentPtr instrument, long flags)
  975.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0026, 0x7000, 0xA82A);
  976.  
  977. extern pascal ComponentResult NAGetKnob(NoteAllocator ci, NoteChannel noteChannel, long knobNumber, long *knobValue)
  978.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0028, 0x7000, 0xA82A);
  979.  
  980. extern pascal ComponentResult NATask(NoteAllocator ci)
  981.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0029, 0x7000, 0xA82A);
  982.  
  983. extern pascal ComponentResult NASetNoteChannelBalance(NoteAllocator ci, NoteChannel noteChannel, long balance)
  984.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002A, 0x7000, 0xA82A);
  985.  
  986. extern pascal ComponentResult NASetInstrumentNumberInterruptSafe(NoteAllocator ci, NoteChannel noteChannel, long instrumentNumber)
  987.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002B, 0x7000, 0xA82A);
  988.  
  989. extern pascal ComponentResult NASetNoteChannelSoundLocalization(NoteAllocator ci, NoteChannel noteChannel, Handle data)
  990.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002C, 0x7000, 0xA82A);
  991.  
  992.  
  993. enum {
  994.     kTuneQueueDepth                = 8                                /* Deepest you can queue tune segments */
  995. };
  996.  
  997. struct TuneStatus {
  998.     unsigned long *                    tune;                        /* currently playing tune */
  999.     unsigned long *                    tunePtr;                    /* position within currently playing piece */
  1000.     TimeValue                         time;                        /* current tune time */
  1001.     short                             queueCount;                    /* how many pieces queued up? */
  1002.     short                             queueSpots;                    /* How many more tunepieces can be queued */
  1003.     TimeValue                         queueTime;                    /* How much time is queued up? (can be very inaccurate) */
  1004.     long                             reserved[3];
  1005. };
  1006. typedef struct TuneStatus TuneStatus;
  1007.  
  1008. typedef pascal void (*TuneCallBackProcPtr)(const TuneStatus *status, long refCon);
  1009. typedef pascal void (*TunePlayCallBackProcPtr)(unsigned long *event, long seed, long refCon);
  1010.  
  1011. #if GENERATINGCFM
  1012. typedef UniversalProcPtr TuneCallBackUPP;
  1013. typedef UniversalProcPtr TunePlayCallBackUPP;
  1014. #else
  1015. typedef TuneCallBackProcPtr TuneCallBackUPP;
  1016. typedef TunePlayCallBackProcPtr TunePlayCallBackUPP;
  1017. #endif
  1018. typedef ComponentInstance TunePlayer;
  1019.  
  1020. enum {
  1021.     kTunePlayerType                = 'tune'
  1022. };
  1023.  
  1024. extern pascal ComponentResult TuneSetHeader(TunePlayer tp, unsigned long *header)
  1025.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  1026.  
  1027. extern pascal ComponentResult TuneGetTimeBase(TunePlayer tp, TimeBase *tb)
  1028.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  1029.  
  1030. extern pascal ComponentResult TuneSetTimeScale(TunePlayer tp, TimeScale scale)
  1031.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  1032.  
  1033. extern pascal ComponentResult TuneGetTimeScale(TunePlayer tp, TimeScale *scale)
  1034.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1035.  
  1036. extern pascal ComponentResult TuneGetIndexedNoteChannel(TunePlayer tp, long i, NoteChannel *nc)
  1037.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  1038.  
  1039. /* Values for when to start. */
  1040.  
  1041. enum {
  1042.     kTuneStartNow                = 1,                            /* start after buffer is implied */
  1043.     kTuneDontClipNotes            = 2,                            /* allow notes to finish their durations outside sample */
  1044.     kTuneExcludeEdgeNotes        = 4,                            /* dont play notes that start at end of tune */
  1045.     kTuneQuickStart                = 8,                            /* Leave all the controllers where they are, ignore start time */
  1046.     kTuneLoopUntil                = 16,                            /* loop a queued tune if there's nothing else in the queue */
  1047.     kTuneStartNewMaster            = 16384
  1048. };
  1049.  
  1050. extern pascal ComponentResult TuneQueue(TunePlayer tp, unsigned long *tune, Fixed tuneRate, unsigned long tuneStartPosition, unsigned long tuneStopPosition, unsigned long queueFlags, TuneCallBackUPP callBackProc, long refCon)
  1051.  FIVEWORDINLINE(0x2F3C, 0x001C, 0x000A, 0x7000, 0xA82A);
  1052.  
  1053. extern pascal ComponentResult TuneInstant(TunePlayer tp, void *tune, long tunePosition)
  1054.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  1055.  
  1056. extern pascal ComponentResult TuneGetStatus(TunePlayer tp, TuneStatus *status)
  1057.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  1058.  
  1059. /* Values for stopping. */
  1060.  
  1061. enum {
  1062.     kTuneStopFade                = 1,                            /* do a quick, synchronous fadeout */
  1063.     kTuneStopSustain            = 2,                            /* don't silece notes */
  1064.     kTuneStopInstant            = 4,                            /* silence notes fast (else, decay them) */
  1065.     kTuneStopReleaseChannels    = 8                                /* afterwards, let the channels go */
  1066. };
  1067.  
  1068. extern pascal ComponentResult TuneStop(TunePlayer tp, long stopFlags)
  1069.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  1070.  
  1071. extern pascal ComponentResult TuneSetVolume(TunePlayer tp, Fixed volume)
  1072.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0010, 0x7000, 0xA82A);
  1073.  
  1074. extern pascal ComponentResult TuneGetVolume(TunePlayer tp)
  1075.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0011, 0x7000, 0xA82A);
  1076.  
  1077. extern pascal ComponentResult TunePreroll(TunePlayer tp)
  1078.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0012, 0x7000, 0xA82A);
  1079.  
  1080. extern pascal ComponentResult TuneUnroll(TunePlayer tp)
  1081.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0013, 0x7000, 0xA82A);
  1082.  
  1083. extern pascal ComponentResult TuneSetNoteChannels(TunePlayer tp, unsigned long count, NoteChannel *noteChannelList, TunePlayCallBackUPP playCallBackProc, long refCon)
  1084.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0014, 0x7000, 0xA82A);
  1085.  
  1086. extern pascal ComponentResult TuneSetPartTranspose(TunePlayer tp, unsigned long part, long transpose, long velocityShift)
  1087.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0015, 0x7000, 0xA82A);
  1088.  
  1089. extern pascal NoteAllocator TuneGetNoteAllocator(TunePlayer tp)
  1090.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0017, 0x7000, 0xA82A);
  1091.  
  1092. extern pascal ComponentResult TuneSetSofter(TunePlayer tp, long softer)
  1093.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  1094.  
  1095. extern pascal ComponentResult TuneTask(TunePlayer tp)
  1096.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0019, 0x7000, 0xA82A);
  1097.  
  1098. extern pascal ComponentResult TuneSetBalance(TunePlayer tp, long balance)
  1099.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001A, 0x7000, 0xA82A);
  1100.  
  1101. extern pascal ComponentResult TuneSetSoundLocalization(TunePlayer tp, Handle data)
  1102.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001B, 0x7000, 0xA82A);
  1103.  
  1104. extern pascal ComponentResult TuneSetHeaderWithSize(TunePlayer tp, unsigned long *header, unsigned long size)
  1105.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001C, 0x7000, 0xA82A);
  1106.  
  1107. typedef unsigned long MusicOpWord;
  1108. typedef unsigned long *MusicOpWordPtr;
  1109. /*
  1110.      QuickTime Music Track Event Formats:
  1111.  
  1112.     At this time, QuickTime music tracks support 5 different event types -- REST events,
  1113.     short NOTE events, short CONTROL events, short GENERAL events, Long NOTE events, 
  1114.     long CONTROL events, and variable GENERAL events.
  1115.  
  1116.         • REST Event (4 bytes/event):
  1117.     
  1118.             (0 0 0) (5-bit UNUSED) (24-bit Rest Duration)
  1119.         
  1120.         • Short NOTE Events (4 bytes/event):
  1121.     
  1122.             (0 0 1) (5-bit Part) (6-bit Pitch) (7-bit Volume) (11-bit Duration)
  1123.         
  1124.             where:    Pitch is offset by 32 (Actual pitch = pitch field + 32)
  1125.  
  1126.         • Short CONTROL Events (4 bytes/event):
  1127.     
  1128.             (0 1 0) (5-bit Part) (8-bit Controller) (1-bit UNUSED) (1-bit Sign) (7-bit MSB) (7-bit LSB)
  1129.                                                                          ( or 15-bit Signed Value)
  1130.         • Short GENERAL Event (4 bytes/event):
  1131.     
  1132.             (0 1 1) (1-bit UNUSED) (12-bit Sub-Type) (16-bit Value)
  1133.     
  1134.         • Long NOTE Events (8 bytes/event):
  1135.     
  1136.             (1 0 0 1) (12-bit Part) (1-bit UNUSED) (7-bit Pitch) (1-bit UNUSED) (7-bit Volume)
  1137.             (1 0) (8-bit UNUSED) (22-bit Duration)
  1138.         
  1139.         • Long CONTROL Event (8 bytes/event):
  1140.         
  1141.             (1 0 1 0) (12-bit Part) (16-bit Value MSB) 
  1142.             (1 0) (14-bit Controller) (16-bit Value LSB)
  1143.     
  1144.         • Long KNOB Event (8 bytes/event):
  1145.     
  1146.             (1 0 1 1) (12-bit Sub-Type) (16-bit Value MSB)
  1147.             (1 0) (14-bit KNOB) (16-bit Value LSB)
  1148.     
  1149.         • Variable GENERAL Length Events (N bytes/event):
  1150.     
  1151.             (1 1 1 1) (12-bit Sub-Type) (16-bit Length)
  1152.                 :
  1153.             (32-bit Data values)
  1154.                 :
  1155.             (1 1) (14-bit UNUSED) (16-bit Length)
  1156.     
  1157.             where:    Length field is the number of LONG words in the record.
  1158.                     Lengths include the first and last long words (Minimum length = 2)
  1159.                 
  1160.     The following event type values have not been used yet and are reserved for 
  1161.     future expansion:
  1162.         
  1163.         • (1 0 0 0)        (8 bytes/event)
  1164.         • (1 1 0 0)        (N bytes/event)
  1165.         • (1 1 0 1)        (N bytes/event)
  1166.         • (1 1 1 0)        (N bytes/event)
  1167.         
  1168.     For all events, the following generalizations apply:
  1169.     
  1170.         -    All duration values are specified in Millisecond units.
  1171.         -     Pitch values are intended to map directly to the MIDI key numbers.
  1172.         -    Controllers from 0 to 127 correspond to the standard MIDI controllers.
  1173.             Controllers greater than 127 correspond to other controls (i.e., Pitch Bend, 
  1174.             Key Pressure, and Channel Pressure).    
  1175. */
  1176. /* Defines for the implemented music event data fields*/
  1177.  
  1178. enum {
  1179.     kRestEventType                = 0x00000000,                    /* lower 3-bits */
  1180.     kNoteEventType                = 0x00000001,                    /* lower 3-bits */
  1181.     kControlEventType            = 0x00000002,                    /* lower 3-bits */
  1182.     kMarkerEventType            = 0x00000003,                    /* lower 3-bits */
  1183.     kUndefined1EventType        = 0x00000008,                    /* 4-bits */
  1184.     kXNoteEventType                = 0x00000009,                    /* 4-bits */
  1185.     kXControlEventType            = 0x0000000A,                    /* 4-bits */
  1186.     kKnobEventType                = 0x0000000B,                    /* 4-bits */
  1187.     kUndefined2EventType        = 0x0000000C,                    /* 4-bits */
  1188.     kUndefined3EventType        = 0x0000000D,                    /* 4-bits */
  1189.     kUndefined4EventType        = 0x0000000E,                    /* 4-bits */
  1190.     kGeneralEventType            = 0x0000000F,                    /* 4-bits */
  1191.     kXEventLengthBits            = 0x00000002,                    /* 2 bits: indicates 8-byte event record */
  1192.     kGeneralEventLengthBits        = 0x00000003,                    /* 2 bits: indicates variable length event record */
  1193.     kEventLen                    = 1L,                            /* length of events in long words */
  1194.     kXEventLen                    = 2L,
  1195.     kRestEventLen                = kEventLen,                    /* length of events in long words */
  1196.     kNoteEventLen                = kEventLen,
  1197.     kControlEventLen            = kEventLen,
  1198.     kMarkerEventLen                = kEventLen,
  1199.     kXNoteEventLen                = kXEventLen,
  1200.     kXControlEventLen            = kXEventLen,
  1201.     kGeneralEventLen            = kXEventLen,                    /* 2 or more, however */
  1202.                                                                 /* Universal Event Defines*/
  1203.     kEventLengthFieldPos        = 30,                            /* by looking at these two bits of the 1st or last word              */
  1204.     kEventLengthFieldWidth        = 2,                            /* of an event you can determine the event length                      */
  1205.                                                                 /* length field: 0 & 1 => 1 long; 2 => 2 longs; 3 => variable length */
  1206.     kEventTypeFieldPos            = 29,                            /* event type field for short events */
  1207.     kEventTypeFieldWidth        = 3,                            /* short type is 3 bits */
  1208.     kXEventTypeFieldPos            = 28,                            /* event type field for extended events */
  1209.     kXEventTypeFieldWidth        = 4,                            /* extended type is 4 bits */
  1210.     kEventPartFieldPos            = 24,
  1211.     kEventPartFieldWidth        = 5,
  1212.     kXEventPartFieldPos            = 16,                            /* in the 1st long word */
  1213.     kXEventPartFieldWidth        = 12,                            /* Rest Events*/
  1214.     kRestEventDurationFieldPos    = 0,
  1215.     kRestEventDurationFieldWidth = 24,
  1216.     kRestEventDurationMax        = ((1L << kRestEventDurationFieldWidth) - 1), /* Note Events*/
  1217.     kNoteEventPitchFieldPos        = 18,
  1218.     kNoteEventPitchFieldWidth    = 6,
  1219.     kNoteEventPitchOffset        = 32,                            /* add to value in pitch field to get actual pitch */
  1220.     kNoteEventVolumeFieldPos    = 11,
  1221.     kNoteEventVolumeFieldWidth    = 7,
  1222.     kNoteEventVolumeOffset        = 0,                            /* add to value in volume field to get actual volume */
  1223.     kNoteEventDurationFieldPos    = 0,
  1224.     kNoteEventDurationFieldWidth = 11,
  1225.     kNoteEventDurationMax        = ((1L << kNoteEventDurationFieldWidth) - 1),
  1226.     kXNoteEventPitchFieldPos    = 0,                            /* in the 1st long word */
  1227.     kXNoteEventPitchFieldWidth    = 16,
  1228.     kXNoteEventDurationFieldPos    = 0,                            /* in the 2nd long word */
  1229.     kXNoteEventDurationFieldWidth = 22,
  1230.     kXNoteEventDurationMax        = ((1L << kXNoteEventDurationFieldWidth) - 1),
  1231.     kXNoteEventVolumeFieldPos    = 22,                            /* in the 2nd long word */
  1232.     kXNoteEventVolumeFieldWidth    = 7,                            /* Control Events*/
  1233.     kControlEventControllerFieldPos = 16,
  1234.     kControlEventControllerFieldWidth = 8,
  1235.     kControlEventValueFieldPos    = 0,
  1236.     kControlEventValueFieldWidth = 16,
  1237.     kXControlEventControllerFieldPos = 0,                        /* in the 2nd long word */
  1238.     kXControlEventControllerFieldWidth = 16,
  1239.     kXControlEventValueFieldPos    = 0,                            /* in the 1st long word */
  1240.     kXControlEventValueFieldWidth = 16,                            /* Knob Events*/
  1241.     kKnobEventValueHighFieldPos    = 0,                            /* 1st long word */
  1242.     kKnobEventValueHighFieldWidth = 16,
  1243.     kKnobEventKnobFieldPos        = 16,                            /* 2nd long word */
  1244.     kKnobEventKnobFieldWidth    = 14,
  1245.     kKnobEventValueLowFieldPos    = 0,                            /* 2nd long word */
  1246.     kKnobEventValueLowFieldWidth = 16,                            /* Marker Events*/
  1247.     kMarkerEventSubtypeFieldPos    = 16,
  1248.     kMarkerEventSubtypeFieldWidth = 8,
  1249.     kMarkerEventValueFieldPos    = 0,
  1250.     kMarkerEventValueFieldWidth    = 16,                            /* General Events*/
  1251.     kGeneralEventSubtypeFieldPos = 16,                            /* in the last long word */
  1252.     kGeneralEventSubtypeFieldWidth = 14,
  1253.     kGeneralEventLengthFieldPos    = 0,                            /* in the 1st & last long words */
  1254.     kGeneralEventLengthFieldWidth = 16
  1255. };
  1256.  
  1257. /* macros for extracting various fields from the QuickTime event records*/
  1258. #define qtma_MASK(bitWidth)             ((1L << (bitWidth)) - 1)
  1259. #define qtma_EXT(val, pos, width)         (((val) >> (pos)) & qtma_MASK(width))
  1260. #define qtma_EventLengthForward(xP,ulen)        {        unsigned long _ext;        unsigned long *lP = (unsigned long *)(xP);        _ext = qtma_EXT(*lP, kEventLengthFieldPos, kEventLengthFieldWidth);        if (_ext != 3) {            ulen = (_ext < 2) ? 1 : 2;            } else {            ulen = (unsigned short)qtma_EXT(*lP, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth);        \
  1261.             if (ulen < 2) {            ulen = lP[1];            }            }            }
  1262. #define qtma_EventLengthBackward(xP,ulen)        {        unsigned long _ext;        unsigned long *lP = (unsigned long *)(xP);        _ext = qtma_EXT(*lP, kEventLengthFieldPos, kEventLengthFieldWidth);        if (_ext != 3) {            ulen = (_ext < 2) ? 1 : 2;            } else {            ulen = (unsigned short)qtma_EXT(*lP, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth);        \
  1263.             if (ulen < 2) {            ulen = lP[-1];            }            }            }
  1264. #define qtma_EventType(x)                 ((qtma_EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth) > 3) ? qtma_EXT(x, kXEventTypeFieldPos, kXEventTypeFieldWidth) : qtma_EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth))
  1265. #define qtma_RestDuration(x)              (qtma_EXT(x, kRestEventDurationFieldPos, kRestEventDurationFieldWidth))
  1266. #define qtma_Part(x)                     (qtma_EXT(x, kEventPartFieldPos, kEventPartFieldWidth))
  1267. #define qtma_XPart(m, l)                 (qtma_EXT(m, kXEventPartFieldPos, kXEventPartFieldWidth))
  1268. #define qtma_NotePitch(x)                 (qtma_EXT(x, kNoteEventPitchFieldPos, kNoteEventPitchFieldWidth) + kNoteEventPitchOffset)
  1269. #define qtma_NoteVolume(x)                 (qtma_EXT(x, kNoteEventVolumeFieldPos, kNoteEventVolumeFieldWidth) + kNoteEventVolumeOffset)
  1270. #define qtma_NoteDuration(x)             (qtma_EXT(x, kNoteEventDurationFieldPos, kNoteEventDurationFieldWidth))
  1271. #define qtma_NoteVelocity qtma_NoteVolume
  1272. #define qtma_XNotePitch(m, l)             (qtma_EXT(m, kXNoteEventPitchFieldPos, kXNoteEventPitchFieldWidth))
  1273. #define qtma_XNoteVolume(m, l)             (qtma_EXT(l, kXNoteEventVolumeFieldPos, kXNoteEventVolumeFieldWidth))
  1274. #define qtma_XNoteDuration(m, l)         (qtma_EXT(l, kXNoteEventDurationFieldPos, kXNoteEventDurationFieldWidth))
  1275. #define qtma_XNoteVelocity qtma_XNoteVolume
  1276. #define qtma_ControlController(x)         (qtma_EXT(x, kControlEventControllerFieldPos, kControlEventControllerFieldWidth))
  1277. #define qtma_ControlValue(x)             (qtma_EXT(x, kControlEventValueFieldPos, kControlEventValueFieldWidth))
  1278. #define qtma_XControlController(m, l)     (qtma_EXT(l, kXControlEventControllerFieldPos, kXControlEventControllerFieldWidth))
  1279. #define qtma_XControlValue(m, l)         (qtma_EXT(m, kXControlEventValueFieldPos, kXControlEventValueFieldWidth))
  1280. #define qtma_MarkerSubtype(x)            (qtma_EXT(x,kMarkerEventSubtypeFieldPos,kMarkerEventSubtypeFieldWidth))
  1281. #define qtma_MarkerValue(x)             (qtma_EXT(x, kMarkerEventValueFieldPos, kMarkerEventValueFieldWidth))
  1282. #define qtma_KnobValue(m,l)                ((qtma_EXT(m,kKnobEventValueHighFieldPos,kKnobEventValueHighFieldWidth) << 16)    | (qtma_EXT(l,kKnobEventValueLowFieldPos,kKnobEventValueLowFieldWidth)))
  1283. #define qtma_KnobKnob(m,l)                (qtma_EXT(l,kKnobEventKnobFieldPos,kKnobEventKnobFieldWidth))
  1284. #define qtma_GeneralSubtype(m,l)        (qtma_EXT(l,kGeneralEventSubtypeFieldPos,kGeneralEventSubtypeFieldWidth))
  1285. #define qtma_GeneralLength(m,l)           (qtma_EXT(m,kGeneralEventLengthFieldPos,kGeneralEventLengthFieldWidth))
  1286. #define qtma_StuffRestEvent(x, duration)                                                                x =     (kRestEventType << kEventTypeFieldPos)                                |    ((long)(duration) << kRestEventDurationFieldPos)
  1287. #define qtma_StuffNoteEvent(x, part, pitch, volume, duration)                                                x =     (kNoteEventType << kEventTypeFieldPos)                                    |     ((long)(part) << kEventPartFieldPos)                                    |    (((long)(pitch) - kNoteEventPitchOffset) << kNoteEventPitchFieldPos)    |    (((long)(volume) - kNoteEventVolumeOffset) << kNoteEventVolumeFieldPos)    |    ((long)(duration) << kNoteEventDurationFieldPos)
  1288. #define qtma_StuffControlEvent(x, part, control, value)                                                    x =     (kControlEventType << kEventTypeFieldPos)                            |     ((long)(part) << kEventPartFieldPos)                                |    ((long)(control) << kControlEventControllerFieldPos)                |    ((long)((value) & qtma_MASK(kControlEventValueFieldWidth)) << kControlEventValueFieldPos)
  1289. #define qtma_StuffMarkerEvent(x, markerType, markerValue)                                                x =     (kMarkerEventType << kEventTypeFieldPos)                            |     ((long)(markerType) << kMarkerEventSubtypeFieldPos)                    |    ((long)(markerValue) << kMarkerEventValueFieldPos)                    w1 =     (kXNoteEventType << kXEventTypeFieldPos)                            |    ((long)(part) << kXEventPartFieldPos)                                |    ((long)(pitch) << kXNoteEventPitchFieldPos),                        w2 =    (kXEventLengthBits << kEventLengthFieldPos)                            |    ((long)(duration) << kXNoteEventDurationFieldPos)                    |    ((long)(volume) << kXNoteEventVolumeFieldPos)
  1290. #define qtma_StuffXControlEvent(w1, w2, part, control, value)                                            w1 =     (kXControlEventType << kXEventTypeFieldPos)                            |    ((long)(part) << kXEventPartFieldPos)                                |    ((long)((value) & qtma_MASK(kXControlEventValueFieldWidth)) << kXControlEventValueFieldPos), w2 =    (kXEventLengthBits << kEventLengthFieldPos)                            |    ((long)(control) << kXControlEventControllerFieldPos)
  1291. #define qtma_StuffKnobEvent(w1, w2, part, knob, value)                                                w1 =    (kKnobEventType << kXEventTypeFieldPos)                            |    ((long)(part) << kXEventPartFieldPos)                            |    ((long)(value >> 16) << kKnobEventValueLowFieldPos),            w2 =    (kXEventLengthBits << kEventLengthFieldPos)                        |    ((long)(knob) << kKnobEventKnobFieldPos)                        |    ((long)(value & 0xFFFF) << kKnobEventValueLowFieldPos)
  1292. #define qtma_StuffGeneralEvent(w1,w2,part,subType,length)                                            w1 =    (kGeneralEventType << kXEventTypeFieldPos)                        |    ((long)(pa    (kGeneralEventLengthBits << kEventLengthFieldPos)                |    ((long)(subType) << kGeneralEventSubtypeFieldPos)                |    ((long)(length) << kGeneralEventLengthFieldPos)
  1293. #define qtma_NeedXGeneralEvent(length)     (((unsigned long)(length)) > (unsigned long)0xffff)
  1294. /* General Event Defined Types*/
  1295.  
  1296. enum {
  1297.     kGeneralEventNoteRequest    = 1,                            /* Encapsulates NoteRequest data structure */
  1298.     kGeneralEventPartKey        = 4,
  1299.     kGeneralEventTuneDifference    = 5,                            /* Contains a standard sequence, with end marker, for the tune difference of a sequence piece (halts QuickTime 2.0 Music) */
  1300.     kGeneralEventAtomicInstrument = 6,                            /* Encapsulates AtomicInstrument record */
  1301.     kGeneralEventKnob            = 7,                            /* knobID/knobValue pairs; smallest event is 4 longs */
  1302.     kGeneralEventMIDIChannel    = 8,                            /* used in tune header, one longword identifies the midi channel it originally came from */
  1303.     kGeneralEventPartChange        = 9,                            /* used in tune sequence, one longword identifies the tune part which can now take over this part's note channel (similar to program change) (halts QuickTime 2.0 Music)*/
  1304.     kGeneralEventNoOp            = 10,                            /* guaranteed to do nothing and be ignored. (halts QuickTime 2.0 Music) */
  1305.     kGeneralEventUsedNotes        = 11                            /* four longwords specifying which midi notes are actually used, 0..127 msb to lsb */
  1306. };
  1307.  
  1308. /* Marker Event Defined Types        // marker is 60 ee vv vv in hex, where e = event type, and v = value*/
  1309.  
  1310. enum {
  1311.     kMarkerEventEnd                = 0,                            /* marker type 0 means: value 0 - stop, value != 0 - ignore*/
  1312.     kMarkerEventBeat            = 1,                            /* value 0 = single beat; anything else is 65536ths-of-a-beat (quarter note)*/
  1313.     kMarkerEventTempo            = 2                                /* value same as beat marker, but indicates that a tempo event should be computed (based on where the next beat or tempo marker is) and emitted upon export*/
  1314. };
  1315.  
  1316. /* UPP call backs */
  1317.  
  1318. #if GENERATINGCFM
  1319. #else
  1320. #endif
  1321.  
  1322. enum {
  1323.     uppMusicMIDISendProcInfo = kPascalStackBased
  1324.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  1325.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(MusicComponent)))
  1326.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  1327.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(MusicMIDIPacket *))),
  1328.     uppMusicMIDIReadHookProcInfo = kPascalStackBased
  1329.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  1330.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(MusicMIDIPacket *)))
  1331.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  1332.     uppMusicOfflineDataProcInfo = kPascalStackBased
  1333.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  1334.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  1335.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  1336.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))),
  1337.     uppTuneCallBackProcInfo = kPascalStackBased
  1338.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const TuneStatus *)))
  1339.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  1340.     uppTunePlayCallBackProcInfo = kPascalStackBased
  1341.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(unsigned long *)))
  1342.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  1343.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  1344. };
  1345.  
  1346. #if GENERATINGCFM
  1347. #define NewMusicMIDISendProc(userRoutine)        \
  1348.         (MusicMIDISendUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDISendProcInfo, GetCurrentArchitecture())
  1349. #define NewMusicMIDIReadHookProc(userRoutine)        \
  1350.         (MusicMIDIReadHookUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDIReadHookProcInfo, GetCurrentArchitecture())
  1351. #define NewMusicOfflineDataProc(userRoutine)        \
  1352.         (MusicOfflineDataUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicOfflineDataProcInfo, GetCurrentArchitecture())
  1353. #define NewTuneCallBackProc(userRoutine)        \
  1354.         (TuneCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTuneCallBackProcInfo, GetCurrentArchitecture())
  1355. #define NewTunePlayCallBackProc(userRoutine)        \
  1356.         (TunePlayCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTunePlayCallBackProcInfo, GetCurrentArchitecture())
  1357. #else
  1358. #define NewMusicMIDISendProc(userRoutine)        \
  1359.         ((MusicMIDISendUPP) (userRoutine))
  1360. #define NewMusicMIDIReadHookProc(userRoutine)        \
  1361.         ((MusicMIDIReadHookUPP) (userRoutine))
  1362. #define NewMusicOfflineDataProc(userRoutine)        \
  1363.         ((MusicOfflineDataUPP) (userRoutine))
  1364. #define NewTuneCallBackProc(userRoutine)        \
  1365.         ((TuneCallBackUPP) (userRoutine))
  1366. #define NewTunePlayCallBackProc(userRoutine)        \
  1367.         ((TunePlayCallBackUPP) (userRoutine))
  1368. #endif
  1369.  
  1370. #if GENERATINGCFM
  1371. #define CallMusicMIDISendProc(userRoutine, self, refCon, mmp)        \
  1372.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMusicMIDISendProcInfo, (self), (refCon), (mmp))
  1373. #define CallMusicMIDIReadHookProc(userRoutine, mp, myRefCon)        \
  1374.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMusicMIDIReadHookProcInfo, (mp), (myRefCon))
  1375. #define CallMusicOfflineDataProc(userRoutine, SoundData, numBytes, myRefCon)        \
  1376.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMusicOfflineDataProcInfo, (SoundData), (numBytes), (myRefCon))
  1377. #define CallTuneCallBackProc(userRoutine, status, refCon)        \
  1378.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTuneCallBackProcInfo, (status), (refCon))
  1379. #define CallTunePlayCallBackProc(userRoutine, event, seed, refCon)        \
  1380.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTunePlayCallBackProcInfo, (event), (seed), (refCon))
  1381. #else
  1382. #define CallMusicMIDISendProc(userRoutine, self, refCon, mmp)        \
  1383.         (*(userRoutine))((self), (refCon), (mmp))
  1384. #define CallMusicMIDIReadHookProc(userRoutine, mp, myRefCon)        \
  1385.         (*(userRoutine))((mp), (myRefCon))
  1386. #define CallMusicOfflineDataProc(userRoutine, SoundData, numBytes, myRefCon)        \
  1387.         (*(userRoutine))((SoundData), (numBytes), (myRefCon))
  1388. #define CallTuneCallBackProc(userRoutine, status, refCon)        \
  1389.         (*(userRoutine))((status), (refCon))
  1390. #define CallTunePlayCallBackProc(userRoutine, event, seed, refCon)        \
  1391.         (*(userRoutine))((event), (seed), (refCon))
  1392. #endif
  1393.  
  1394. /* selectors for component calls */
  1395. enum {
  1396.     kMusicGetDescriptionSelect                        = 0x0001,
  1397.     kMusicGetPartSelect                                = 0x0002,
  1398.     kMusicSetPartSelect                                = 0x0003,
  1399.     kMusicSetPartInstrumentNumberSelect                = 0x0004,
  1400.     kMusicGetPartInstrumentNumberSelect                = 0x0005,
  1401.     kMusicStorePartInstrumentSelect                    = 0x0006,
  1402.     kMusicGetPartAtomicInstrumentSelect                = 0x0009,
  1403.     kMusicSetPartAtomicInstrumentSelect                = 0x000A,
  1404.     kMusicGetInstrumentKnobDescriptionObsoleteSelect = 0x000D,
  1405.     kMusicGetDrumKnobDescriptionObsoleteSelect        = 0x000E,
  1406.     kMusicGetKnobDescriptionObsoleteSelect            = 0x000F,
  1407.     kMusicGetPartKnobSelect                            = 0x0010,
  1408.     kMusicSetPartKnobSelect                            = 0x0011,
  1409.     kMusicGetKnobSelect                                = 0x0012,
  1410.     kMusicSetKnobSelect                                = 0x0013,
  1411.     kMusicGetPartNameSelect                            = 0x0014,
  1412.     kMusicSetPartNameSelect                            = 0x0015,
  1413.     kMusicFindToneSelect                            = 0x0016,
  1414.     kMusicPlayNoteSelect                            = 0x0017,
  1415.     kMusicResetPartSelect                            = 0x0018,
  1416.     kMusicSetPartControllerSelect                    = 0x0019,
  1417.     kMusicGetPartControllerSelect                    = 0x001A,
  1418.     kMusicGetMIDIProcSelect                            = 0x001B,
  1419.     kMusicSetMIDIProcSelect                            = 0x001C,
  1420.     kMusicGetInstrumentNamesSelect                    = 0x001D,
  1421.     kMusicGetDrumNamesSelect                        = 0x001E,
  1422.     kMusicGetMasterTuneSelect                        = 0x001F,
  1423.     kMusicSetMasterTuneSelect                        = 0x0020,
  1424.     kMusicGetInstrumentAboutInfoSelect                = 0x0022,
  1425.     kMusicGetDeviceConnectionSelect                    = 0x0023,
  1426.     kMusicUseDeviceConnectionSelect                    = 0x0024,
  1427.     kMusicGetKnobSettingStringsSelect                = 0x0025,
  1428.     kMusicGetMIDIPortsSelect                        = 0x0026,
  1429.     kMusicSendMIDISelect                            = 0x0027,
  1430.     kMusicReceiveMIDISelect                            = 0x0028,
  1431.     kMusicStartOfflineSelect                        = 0x0029,
  1432.     kMusicSetOfflineTimeToSelect                    = 0x002A,
  1433.     kMusicGetInstrumentKnobDescriptionSelect        = 0x002B,
  1434.     kMusicGetDrumKnobDescriptionSelect                = 0x002C,
  1435.     kMusicGetKnobDescriptionSelect                    = 0x002D,
  1436.     kMusicGetInfoTextSelect                            = 0x002E,
  1437.     kMusicGetInstrumentInfoSelect                    = 0x002F,
  1438.     kMusicTaskSelect                                = 0x0031,
  1439.     kMusicSetPartInstrumentNumberInterruptSafeSelect = 0x0032,
  1440.     kMusicSetPartSoundLocalizationSelect            = 0x0033,
  1441.     kMusicGenericConfigureSelect                    = 0x0100,
  1442.     kMusicGenericGetPartSelect                        = 0x0101,
  1443.     kMusicGenericGetKnobListSelect                    = 0x0102,
  1444.     kMusicDerivedMIDISendSelect                        = 0x0200,
  1445.     kMusicDerivedSetKnobSelect                        = 0x0201,
  1446.     kMusicDerivedSetPartSelect                        = 0x0202,
  1447.     kMusicDerivedSetInstrumentSelect                = 0x0203,
  1448.     kMusicDerivedSetPartInstrumentNumberSelect        = 0x0204,
  1449.     kMusicDerivedSetMIDISelect                        = 0x0205,
  1450.     kMusicDerivedStorePartInstrumentSelect            = 0x0206,
  1451.     kInstrumentGetInstSelect                        = 0x0001,
  1452.     kInstrumentGetInfoSelect                        = 0x0002,
  1453.     kInstrumentInitializeSelect                        = 0x0003,
  1454.     kInstrumentOpenComponentResFileSelect            = 0x0004,
  1455.     kInstrumentCloseComponentResFileSelect            = 0x0005,
  1456.     kInstrumentGetComponentRefConSelect                = 0x0006,
  1457.     kInstrumentSetComponentRefConSelect                = 0x0007,
  1458.     kNARegisterMusicDeviceSelect                    = 0x0000,
  1459.     kNAUnregisterMusicDeviceSelect                    = 0x0001,
  1460.     kNAGetRegisteredMusicDeviceSelect                = 0x0002,
  1461.     kNASaveMusicConfigurationSelect                    = 0x0003,
  1462.     kNANewNoteChannelSelect                            = 0x0004,
  1463.     kNADisposeNoteChannelSelect                        = 0x0005,
  1464.     kNAGetNoteChannelInfoSelect                        = 0x0006,
  1465.     kNAPrerollNoteChannelSelect                        = 0x0007,
  1466.     kNAUnrollNoteChannelSelect                        = 0x0008,
  1467.     kNASetNoteChannelVolumeSelect                    = 0x000B,
  1468.     kNAResetNoteChannelSelect                        = 0x000C,
  1469.     kNAPlayNoteSelect                                = 0x000D,
  1470.     kNASetControllerSelect                            = 0x000E,
  1471.     kNASetKnobSelect                                = 0x000F,
  1472.     kNAFindNoteChannelToneSelect                    = 0x0010,
  1473.     kNASetInstrumentNumberSelect                    = 0x0011,
  1474.     kNAPickInstrumentSelect                            = 0x0012,
  1475.     kNAPickArrangementSelect                        = 0x0013,
  1476.     kNASetDefaultMIDIInputSelect                    = 0x0015,
  1477.     kNAGetDefaultMIDIInputSelect                    = 0x0016,
  1478.     kNAUseDefaultMIDIInputSelect                    = 0x0019,
  1479.     kNALoseDefaultMIDIInputSelect                    = 0x001A,
  1480.     kNAStuffToneDescriptionSelect                    = 0x001B,
  1481.     kNACopyrightDialogSelect                        = 0x001C,
  1482.     kNAGetIndNoteChannelSelect                        = 0x001F,
  1483.     kNAGetMIDIPortsSelect                            = 0x0021,
  1484.     kNAGetNoteRequestSelect                            = 0x0022,
  1485.     kNASendMIDISelect                                = 0x0023,
  1486.     kNAPickEditInstrumentSelect                        = 0x0024,
  1487.     kNANewNoteChannelFromAtomicInstrumentSelect        = 0x0025,
  1488.     kNASetAtomicInstrumentSelect                    = 0x0026,
  1489.     kNAGetKnobSelect                                = 0x0028,
  1490.     kNATaskSelect                                    = 0x0029,
  1491.     kNASetNoteChannelBalanceSelect                    = 0x002A,
  1492.     kNASetInstrumentNumberInterruptSafeSelect        = 0x002B,
  1493.     kNASetNoteChannelSoundLocalizationSelect        = 0x002C,
  1494.     kTuneSetHeaderSelect                            = 0x0004,
  1495.     kTuneGetTimeBaseSelect                            = 0x0005,
  1496.     kTuneSetTimeScaleSelect                            = 0x0006,
  1497.     kTuneGetTimeScaleSelect                            = 0x0007,
  1498.     kTuneGetIndexedNoteChannelSelect                = 0x0008,
  1499.     kTuneQueueSelect                                = 0x000A,
  1500.     kTuneInstantSelect                                = 0x000B,
  1501.     kTuneGetStatusSelect                            = 0x000C,
  1502.     kTuneStopSelect                                    = 0x000D,
  1503.     kTuneSetVolumeSelect                            = 0x0010,
  1504.     kTuneGetVolumeSelect                            = 0x0011,
  1505.     kTunePrerollSelect                                = 0x0012,
  1506.     kTuneUnrollSelect                                = 0x0013,
  1507.     kTuneSetNoteChannelsSelect                        = 0x0014,
  1508.     kTuneSetPartTransposeSelect                        = 0x0015,
  1509.     kTuneGetNoteAllocatorSelect                        = 0x0017,
  1510.     kTuneSetSofterSelect                            = 0x0018,
  1511.     kTuneTaskSelect                                    = 0x0019,
  1512.     kTuneSetBalanceSelect                            = 0x001A,
  1513.     kTuneSetSoundLocalizationSelect                    = 0x001B,
  1514.     kTuneSetHeaderWithSizeSelect                    = 0x001C
  1515. };
  1516.  
  1517. #if PRAGMA_ALIGN_SUPPORTED
  1518. #pragma options align=reset
  1519. #endif
  1520.  
  1521. #if PRAGMA_IMPORT_SUPPORTED
  1522. #pragma import off
  1523. #endif
  1524.  
  1525. #ifdef __cplusplus
  1526. }
  1527. #endif
  1528.  
  1529. #endif /* __QUICKTIMEMUSIC__ */
  1530.  
  1531.